﻿function MainProducts(id) {
    this.Id = id;
};

MainProducts.prototype.Bind = function () {
    var params = {
        action: "GetProductConfiguration"
    };
    var parentObj = this;
    this.sendAjax("HttpHandlers/MainHandler.ashx", { type: 'POST', params: JSON.stringify(params) }, function (data) {
        parentObj.successfullGetData.call(parentObj, data);
    }, handleErrorCalback);
};

MainProducts.prototype.sendAjax = function (url, params, callbackSuccess, callbackError) {
    $.ajax({
        type: "POST",
        dataType: 'json',
        url: url + "?dt=" + new Date().getTime(),
        data: params,
        success: callbackSuccess,
        error: callbackError
    });
};

successfullGetData.prototype.sendAjax = function (parentObj, data) {
    
};